﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BusinessObjects.BusinessRules;

namespace BusinessObjects.HumanResources
{
    public class Department : BusinessObject
    {
        public Department()
        {
            AddRule(new ValidateRequired("DepartmentCode"));
            AddRule(new ValidateLength("DepartmentCode", 0, 20));

            AddRule(new ValidateRequired("DepartmentName"));
            AddRule(new ValidateLength("DepartmentName", 0, 255));

            AddRule(new ValidateRequired("RestaurantId"));
        }

        public Department(string departmentId, string departmentCode, string departmentName, bool isParent, string parentDepartmentId,
                            string restaurantId, string description, bool isActive)
            : this()
        {
            DepartmentID = departmentId;
            DepartmentCode = departmentCode;
            DepartmentName = departmentName;
            IsParent = isParent;
            ParentDepartmentID = parentDepartmentId;
            RestaurantId = restaurantId;
            Description = description;
            IsActive = isActive;
        }

        public string DepartmentID { get; set; }

        public string DepartmentCode { get; set; }

        public string DepartmentName { get; set; }

        public bool IsParent { get; set; }

        public string ParentDepartmentID { get; set; }

        public string RestaurantId { get; set; }

        public string Description { get; set; }

        public bool IsActive { get; set; }
    }
}
